<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<%include("/common/include.html"){}%>
		<style type="text/css">
			ul{
				height:auto;
				width:100%;
				padding:10px;
			}
			ul li{
				width:230px;
				display:inline-block;
			}
		</style>
	</head>
	<body style="overflow-x:hidden;">
	<input id="ORGANIDS"  type="hidden" value="${orgid!}">
	<form>
	<!-- <%include("/commonUtil/ddcSearchCustomer.html"){}%> -->
	<%include("/commonUtil/ddcSearchVehicle.html"){}%>
	</form>
	<div data-options="region:'center'" style="overflow-x:hidden;">
	<table class="easyui-datagrid" id ="announceInfo" style="width:100%;height:auto;"></table>
	</div>
		
	<script>
	
	function queryBusiness(){
		$('#announceInfo').datagrid({
			cls: "theme-datagrid",
			title:"车辆",
			singleSelect: true,
			rownumbers: true, //显示序号
			fitColumns:true,
			pagination: true,
			pageSize: 10,
			url: "zydjywsl/getlist",
			queryParams: {
				'_query.HPHM': $("#HPHM").val(),
			},
		    method: 'post',
		    collapsible:true,
		    columns:[[
						{field:'clsbdh',title:'车辆识别代号',width:20,align:'center'},
						{field:'cllx',title:'车辆类型',width:10,align:'center'},
						{field:'hphm',title:'号牌号码',width:8,align:'center'},
						{field:'ownername',title:'车辆所有人',width:15, align:'center'},
						{field:'organ',title:'注册机构',width:15, align:'center'},
						{field:'registdate',title:'注册日期',width:10, align:'center'},
						{field:'jbr',title:'经办人',width:7, align:'center'},
						{field:'operate1',title:'操作',width:10, align:'center',
							formatter: function(value,row,index){
								return '<a onclick='+'details(\'' + row.ids + '\')'+' class='+'button-edit button-success  l-btn l-btn-small'+'><span class='+'l-btn-left'+'><span  style='+'color:red'+' class='+'l-btn-text'+'>详情</span></span></a>'
							}
						},
						{field:'operate2',title:'业务办理',width:10, align:'center',
							formatter: function(value,row,index){
								return '<a onclick='+'ywsl(\'' + row.businesstype + '\',\'' + row.ids + '\')'+' class='+'button-edit button-success  l-btn l-btn-small'+'><span class='+'l-btn-left'+'><span  style='+'color:red'+' class='+'l-btn-text'+'></span>办理</span></a>'
							}
						}
						]]
		})
		
	}
	
	
	$(document).ready(function () {
		$("#HPHM").combobox({
			onChange: function (n,o) {
				$("#LSH").textbox("clear");
				//$("#SFZMHM").textbox("clear");
				 queryBusiness();
			}
		});
		/* $("#LSH").combobox({
			onChange: function (n,o) {
				$("#HPHM").textbox("clear");
				//$("#SFZMHM").textbox("clear");
				 queryBusiness();
			}
		}); */
		/* $("#SFZMHM").combobox({
			onChange: function (n,o) {
				$("#HPHM").textbox("clear");
				$("#LSH").textbox("clear");
				 queryCustomer();
			}
		}); */
		queryBusiness();
	});
	
	function clearsj(){
		location.reload();
	}
	
	/* function operate(){
		return '<a href="#" style="display:inline-block;height:25px;width:80px;background:#1CCE78;line-height:25px;border-radius:3px;color:#ffffff;" onclick="check()">查&nbsp;&nbsp;看</a>';
	} */
	function details(ids){
		loadViewDialog('车辆详情', '${cxt !}/zydjywsl/details?ids=' + ids,null,1100,550);
	}
	
	function ywsl(businesstype,ids){
		var type = '';
		if(businesstype == '1'){
			type = '注册登记';
		}else if(businesstype == '2'){
			type = '转移登记';
		}else if(businesstype == '3'){
			type = '变更登记';
		}else if(businesstype == '4'){
			type = '注销登记';
		}else if(businesstype == '5'){
			type = '补换号牌';
		}else if(businesstype == '6'){
			type = '补换证件';
		}
		if (businesstype != "0"){
			parent.$.messager.alert('提示信息','当前车辆正在办理'+type+'业务,暂不可办理此业务!');
			return false;
		}
		
		loadDialog($('#announceInfo'),null, '业务受理', '${cxt !}/zydjywsl/ywsl?ids=' + ids,1100,700);
	}
	</script>
	</body>
</html>
